<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<head>
    <meta charset="utf-8">
    <title><title>Title</title></title>

    <script type="text/javascript">

        function x() {
            window.href="";
        }

    </script>
</head>
<body>

<hr>
搜索<br><br>
<form action="/user/selectByPage" method="post">
   用户名：<input id="name" name="name" />
     <input name="pageNum" value="1" hidden />
    <input  name="pageSize" value="3" hidden/>

    <button>搜索</button>
    <button>重置</button>

</form>
<br><br>
<hr>

<a href="../jsp/user_add.jsp">新增</a>
<br>
    <table border="1">
        <tr>
            <th>id</th>
            <td>姓名</td>
            <td>性别</td>
            <td>生日</td>
            <td>创建日期</td>
            <td>操作</td>
        </tr>
        <c:forEach items="${qr.data}" var="user">
            <tr>
                <td>${user.id}</td>
                <td>${user.name}</td>
                <td>${user.sex}</td>
                <td><fmt:formatDate value="${user.birthday}" type="date" pattern="yyyy-MM-dd"/></td>
                <td><fmt:formatDate value="${user.createtime}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>

                <td><a href="/user/modifyById/${user.id}">修改</a></td>
                <td><a href="/user/delById/${user.id}">删除</a></td>

            </tr>
        </c:forEach>
    </table>
页：
<c:forEach begin="1" end="${qr.pages}" varStatus="st" >
      <a  href="/user/selectByPage?pageSize=3&pageNum=${st.index}">${st.index}</a>&nbsp;&nbsp;&nbsp;&nbsp;
    </c:forEach>
总页数：${qr.pages}  &nbsp;&nbsp;&nbsp;&nbsp; 总记录数：${qr.count}
</body>
</html>
